package com.kevin.elastic.job;

import java.util.ArrayList;
import java.util.List;

import com.dangdang.ddframe.job.api.ShardingContext;
import com.dangdang.ddframe.job.api.dataflow.DataflowJob;

public class DataflowElasticJob implements DataflowJob<Object> {

	@Override
	public List<Object> fetchData(ShardingContext context) {
		switch (context.getShardingItem()) {
		case 0:
			List<Object> data = new ArrayList<Object>();
			return data;
		case 1:
			List<Object> data1 = new ArrayList<Object>();
			return data1;
		case 2:
			List<Object> data2 = new ArrayList<Object>();
			return data2;
			// case n: ...
		}
		return null;
	}

	@Override
	public void processData(ShardingContext shardingContext, List<Object> data) {

	}
}